package cn.dglydrpy.study.spring.ioc.xml;

import java.io.Serializable;

/*
 * @Description:演示基于xml的依赖注入  
 * @author:dglydrpy
 * @date:2019年4月17日 上午1:24:51 
 * @version:1.0
 */
public class DIBean implements Serializable{
	
	private static final long serialVersionUID = 1L;
	
	private LifeCycleBean lifeCycleBean; //组合
	private Tool tool; //组合
	
	public DIBean(LifeCycleBean lifeCycleBean){
		this.lifeCycleBean = lifeCycleBean;
		System.out.println("构造方法:创建了DIBean");
	}
	
	public DIBean(){}
	
	public void work(){
		System.out.println(lifeCycleBean.getName()+"使用"+tool+"砍树!");
	}
	
	public LifeCycleBean getLifeCycleBean() {
		return lifeCycleBean;
	}
	public void setLifeCycleBean(LifeCycleBean lifeCycleBean) {
		this.lifeCycleBean = lifeCycleBean;
	}
	public Tool getTool() {
		return tool;
	}
	public void setTool(Tool tool) {
		this.tool = tool;
	}
	
	@Override
	public String toString() {
		return "DIBean [lifeCycleBean=" + lifeCycleBean + ", tool=" + tool + "]";
	}
}
